#include "room.h"

Room::Room()
{
    
}

int Room::getID()
{
    return id;
}

QString Room::getName()
{
    return name;
}

QString Room::getDescribe()
{
    return describe;
}

int Room::getNum()
{
    return num;
}

int Room::getUpID()
{
    return upID;
}

int Room::getType()
{
    return type;
}

void Room::setID(int _id)
{
    id = _id;
}

void Room::setName(QString _name)
{
    name = _name;
}

void Room::setDescribe(QString _describe)
{
    describe = _describe;
}

void Room::setNum(int _num)
{
    num = _num;
}

void Room::setUpID(int _upID)
{
    upID = _upID;
}

void Room::setType(int _type)
{
    type = _type;
}

void Room::setAll(int _id, QString _name, QString _describe, int _num, int _upID, int _type)
{
    id = _id;
    name = _name;
    describe = _describe;
    num = _num;
    upID = _upID;
    type = _type;
}

bool Room::saveAllToDB(int _id, QString _name, QString _describe, int _num, int _upID, int _type)
{
    return insertBuilding(_id, _name, _describe, _num, _upID, _type);
}

bool Room::deleteFromDB(int _id)
{
    return deleteBuildingByID(_id);
}

bool Room::updateNameToDB(int _id, QString _name)
{
    return updateBuildingName(_id, _name);
}

bool Room::updateDescribeToDB(int _id, QString _describe)
{
    return updateBuildingDescribe(_id, _describe);
}

bool Room::updateNumToDB(int _id, int _num)
{
    return updateBuildingNum(_id, _num);
}

QString Room::getNameFromDBByID()
{
    return selectBuilgingNameByID(this->id);
}
